package com.composite;

import java.util.ArrayList;
import java.util.List;

public class Employee {
	
	private String name;
	private String dept;
	private int salary;
	private List<Employee> subodinates;
	
	public Employee(String name, String dept, int salary) {
		super();
		this.name = name;
		this.dept = dept;
		this.salary = salary;
		this.subodinates = new ArrayList<Employee>();
	}
	
	public void add(Employee emp)
	{
		subodinates.add(emp);
	}
	
	public void remove(Employee emp)
	{
		subodinates.remove(emp);
	}

	/**
	 * @return the subodinates
	 */
	public List<Employee> getSubodinates() {
		return subodinates;
	}
	
	public String toString()
	{
		return ("Employee: [ Name: " + name + ", dept: " + dept + ", salary: " + salary + " ]");
	}
	
}
